// 创建路由对象，并配置
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            redirect: '/user'
        },
        {
            path: '/user',
            component: () => import('@/views/User.vue')
        },
        {
            // 动态路由
            path: '/user/edit/:id',
            component: () => import('@/views/UserEdit.vue')
        },
    ]
})

export default router